<script> 
	
$(document).ready(function(){
	$(".inline").colorbox({inline:true, width:"500px"});
		$("#click").click(function(){ 
			$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
	
});
function checkNull(){
	var phone = $('#phone').val();
	var contact = $('#contact').val();
	var name = $('#name').val();
	if(name.length == 0 ){
		$("#name").next().html("请输入公司名称");
		return
	}
	if(contact.length == 0 ){
		$("#contact").next().html("请填写联系人");
		return
	}
	if(phone.length == 0 ){
		$("#phone").next().html("请填写联系方式");
		return
	}
	apply();
}

$(function(){
	var phone = $('#phone').val();
	var contact = $('#contact').val();
	var name = $('#name').val();
	$("#name").blur(function(){
		if(name.length == 0 ){
			$("#name").next().html("");
		}
	});
	$("#contact").blur(function(){
		if(name.length == 0 ){
			$("#contact").next().html("");
		}
	});
	$("#phone").blur(function(){
		if(name.length == 0 ){
			$("#phone").next().html("");
		}
	});
})
function apply(){
	var parm = $('#applyBid').serialize();
	var url = create_url('supplyinfo-applysi');
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			if ('success' == result) {
				sys_msg('参与成功!');
				cleanText_siDetail();
				$.fn.colorbox.close();
			}
		}
	});
}

function cleanText_siDetail(){
	$('#phone').val("");
	$('#contact').val("");
	$('#name').val("");
	$('#content').val("");
}
</script>
	<div class="pageLeft">
		<h2>最新战报</h2>
		<div class="newest">
			<ul>
				<#if silist??>
					<#list silist as si> 
						<#if (si_index>4)><#break></#if>
						<li><a href="#" title="" class="company">${si.name}</a>成功中标了<a href="#" title="">${si.title}</a></li>
					</#list>
				</#if>
			</ul>
		</div>
		<div class="release"><a href="${contextPath}bsLogin1.html" title="发布供应信息">发布供应信息</a></div>
	</div>
	<div class="pageRight">
		<div class="pageRightPath"><a href="${contextPath}index.html" title="">首页</a> > <a href="${contextPath}initList.html?type=si" title="">供应信息</a></div>
		<div class="pageRightTitle">
		 	<h1>${info.title}</h1>
		</div>
		<div class="demandDetail">
			<div class="demandDetailLeft"><img style="width:230px;height:230px;" src="${contextPath}upload/supplyInfoAnnex/${(sia.sn)!''}.${(sia.ext)!''}"  alt=""/></div>
			<div class="demandDetailRight">
				<dl>
					<dt>品 牌：</dt>
					<dd>${(info.brand)!'无'}</dd>
					<dt>规 格：</dt>
					<dd>${(info.norm)!'无'} </dd>
					<dt>数 量：</dt>
					<dd>${(info.num)!'无'} </dd>
					<dt>价 格：</dt>
					<dd><b>${(info.price)!'无'}</b></dd>
					<dt>地 址：</dt>
					<dd>${(info.address)!'无'} </dd>
					<dt>有效期至：</dt>
					<dd>${info.stopTime?string('yyyy年MM月dd日')} </dd>
					<dt>浏览数：</dt>
					<dd>${(info.browseNum)!'无'} </dd>
				</dl>
			</div>
			<div class="demandContent">
				<h2>供应详情</h2>
				<div class="demandTxt">
			　　	${(info.content)!'无'}
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<div class="participateBtn"><a class='inline' href="#inline_content3" title="">我要参与</a></div>

	</div>
	<div class="clear"></div>
	 
<!-- 弹出框 -->
<div style='display:none'>
	
		<div id='inline_content3' class="login">
		<form id="applyBid">
		<input type="hidden" name="sic" value="${(info.code)!''}"/>
			<h2>我要参与</strong></h2>
			<dl>
				<dt><em>*</em>公司名称</dt>
				<dd><input name="name" id="name" type="text"  class="loginInput" /><em></em></dd>
			</dl>
			<dl>
				<dt><em>*</em>联系人</dt>
				<dd><input name="contact" id="contact" type="text" class="loginInput" /><em></em></dd>
			</dl>
			<dl>
				<dt><em>*</em>联系方式</dt>
				<dd><input name="phone" id="phone" type="text" class="loginInput" /><em></em></dd>
			</dl>
			<dl>
				<dt>留 言</dt>
				<dd><textarea name="content" id="content" class="loginInput2"></textarea></dd>
			</dl>
			<dl>
				<dt> </dt>
				<dd><input  type="button" value="提 交" class="loginBotton"  onclick="checkNull()"/></dd>
			</dl>
		</form>
			<div class="clear"></div>
		</div>
</div>
